package com.imu.purse.modules.trade.form;

import java.math.BigDecimal;
import java.util.List;

import javax.persistence.Column;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import io.swagger.annotations.Api;
import org.hibernate.validator.constraints.NotBlank;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 转账信息
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-03-22 10:33:21
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
@Data
public class TransForm
{
	//收款账号
	@JSONField(ordinal = 1)
	@Column(name="rec_account")
	@NotBlank(message="收款账号不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@ApiModelProperty(value="收款账号", name="payAccount", required = true, example="13800000000")
	private String recAccount;
	
	//订单号
	@JSONField(ordinal = 2)
	@Column(name="order_no")
	@NotBlank(message="订单号不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@ApiModelProperty(value = "订单号", name="orderNo", required = true, example="201801010100111")
	private String orderNo;
	
	//支付密码
	@JSONField(ordinal = 3)
	@NotBlank(message="支付密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@ApiModelProperty(value = "支付密码", name="payPwd", required = true, example="MD5")
	private String payPwd;
	
	//安全码
	@JSONField(ordinal = 4)
	@NotBlank(message="身份认证码不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@ApiModelProperty(value = "身份认证码", name="saveCode", required = true, example="123456")
	private String saveCode;
	
	//交易余额
	@JSONField(ordinal = 5)
	@Column(name="money")
	@ApiModelProperty(value = "数量", name="money", required = true, example="100")
	@NotNull(message="数量不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Min(value=1, message="数量必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
	private BigDecimal money;
	
	//交易时间
	@JSONField(ordinal = 6)
	@Column(name="order_create")
	@ApiModelProperty(value = "交易时间", name="orderCreate", required = true, example="100")
	private Long orderCreate;
	
	//描述详情
	@JSONField(ordinal = 7)
	@Column(name="detail")
	@ApiModelProperty(value = "描述", hidden = true)
	private String detail;
	
	//交易ID
	@ApiModelProperty(value = "交易ID", hidden = true)
	private String transId;
	
	//交易状态
	@ApiModelProperty(value = "交易状态", hidden = true)
	private Integer transStatus;
	
	@ApiModelProperty(value = "转账人地址", hidden = true)
	private String payAddr;

	@ApiModelProperty(value = "转账人手机号码", hidden = true)
	private String payPhone;

	@ApiModelProperty(value = "接受人地址", hidden = true)
	private String recAddr;

	@ApiModelProperty(value = "接受人手机号码", hidden = true)
	private String recPhone;

	@ApiModelProperty(value = "交易费用", hidden = true)
	private BigDecimal fee;

	@ApiModelProperty(value = "转出人ID", hidden = true)
	private Long payUserId;

	@ApiModelProperty(value = "接受人ID", hidden = true)
	private Long recUserId;

	@ApiModelProperty(value = "核心钱包地址", hidden = true)
	private String coreAddr;

	@ApiModelProperty(value = "交易表中ID", hidden = true)
	private List<Long> ids;

	@ApiModelProperty(value = "外部标记", hidden = true)
	private Boolean outFlag;

	@ApiModelProperty(value = "以太坊类型，0:以太坊，1:代币")
	private Integer ytfType;
}
